//
//  MKLineComicTableViewCell.m
//  ManKeCartoon
//
//  Created by 邹功梁 on 15/10/22.
//  Copyright © 2015年 ManKe. All rights reserved.
//
#import "MKLineComicTableViewCell.h"

@implementation MKLineComicTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _comicImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, (SCREEN_HEIGHT - 64) / 3 - 1)];
        
        _grayLineView = [[UIView alloc] initWithFrame:CGRectMake(0, (SCREEN_HEIGHT - 64) / 3 - 1, SCREEN_WIDTH, 1)];
        [_grayLineView setBackgroundColor:[UIColor grayColor]];
        
        _countLabel = [[UILabel alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - 40, (SCREEN_HEIGHT - 64) / 3 - 60, 55, 30)];
        _countLabel.textAlignment = NSTextAlignmentLeft;
        [_countLabel setBackgroundColor:[UIColor orangeColor]];
        [_countLabel setTextColor:[UIColor whiteColor]];
        _countLabel.layer.masksToBounds = YES;
        _countLabel.layer.cornerRadius = 15.;
        
        [_comicImage addSubview:_countLabel];
        [self.contentView addSubview:_comicImage];
        [self.contentView addSubview:_grayLineView];
    }
    return self;
}
- (void)setLightComicModel:(MKLightComicModel *)model
{
    [_comicImage sd_setImageWithURL:[NSURL URLWithString:model.cover_url]];
    [_countLabel setText:[NSString stringWithFormat:@"   %@", model.lated_seqno]];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
